<form action="{:url()}" method="post" data-auto="true" class="layui-form layui-card" data-table-id="MenuTable">

    <div class="layui-card-body">

        <div class="layui-form-item">
            <label class="layui-form-label label-required-next">上级菜单</label>
            <div class="layui-input-block">
                <select name='pid' class='layui-select' lay-search>
                    {foreach $menus as $val}
                    <option value="{$val['id']}" {if condition="isset($vo.pid) && ($val['id'] eq $vo.pid) "} selected {/if}>{$val["title_show"]|raw}</option>
                    {/foreach}
                </select>
                <p class="help-block"><b>必选</b>，请选择上级菜单或顶级菜单 ( 目前最多支持三级菜单 )</p>
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label">菜单名称</label>
            <div class="layui-input-block">
                <input name="name" value="{$vo.name|default=''}" required vali-name="菜单名称" placeholder="请输入菜单名称" class="layui-input" type="text">
                <p class="help-block"><b>必选</b>，请填写菜单名称 ( 如：系统管理 )，建议字符不要太长，一般 4-6 个汉字</p>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">分组</label>
            <div class="layui-input-block">
                <input name="group" placeholder="请输入分组" value="{$vo.group|default=''}" class="layui-input" type="text">
                <p class="help-block"><b>必选</b>，展示左侧导航栏</p>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">菜单链接</label>
            <div class="layui-input-block">
                <input type="text" name="url" required vali-name="菜单链接" placeholder="请输入菜单链接" value="{$vo.url|default=''}" class="layui-input">
                <p class="help-block">
                    <b>必选</b>
                </p>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">排序</label>
            <div class="layui-input-block">
                <input type="number" name="sort" required vali-name="排序" placeholder="请输入排序" value="{$vo.sort|default='50'}" class="layui-input">
                <p class="help-block">
                    <b>必须是数字排序越小越靠前</b>
                </p>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">菜单图标</label>
            <div class="layui-input-block">
                <div class="layui-input-inline">
                    <input placeholder="请输入或选择图标" name="icon" value="{$vo.icon|default=''}" class="layui-input" type="text">
                </div>
                <button data-icon='icon' type='button' class='layui-btn layui-btn-primary'>选择图标</button>
                <p class="help-block"><b>可选</b>，设置菜单选项前置图标，目前支持 layui 字体图标及 iconfont 定制字体图标。</p>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">是否菜单</label>
            <div class="layui-input-block">
                <input type="radio" name="is_menu" value="0" title="否" {if condition="isset($vo.is_menu) && ($vo.is_menu eq 0)"} checked {/if}>
                <input type="radio" name="is_menu" value="1" title="是" {if condition="isset($vo.is_menu) && ($vo.is_menu eq 1)"} checked {/if}>
            </div>
        </div>
    </div>
    <div class="hr-line-dashed"></div>
    {notempty name='vo.id'}<input type='hidden' value='{$vo.id}' name='id'>{/notempty}
    <div class="layui-form-item text-center">
        <button class="layui-btn" type='submit'>保存数据</button>
        <button class="layui-btn layui-btn-danger" type='button' data-confirm="确定要取消编辑吗？" data-close>取消编辑</button>
    </div>
</form>
